<?php

$urlList = [
    "http://static.mengkang.net/?a=upload/image/2019/0907/1567834464450406.png",
    "https://static.mengkang.net?a=upload/image/2019/0907/1567834464450406.png",
    "https:/static.mengkang.net?a=upload/image/2019/0907/1567834464450406.png",
    "http://static.mengkang.net:8080/upload/image/2019/0907/1567834464450406.png?a=b#test",
    "http:///static.mengkang.net",
    "static.mengkang.net",
];


foreach ($urlList as $k => $url) {
    echo "\n=================case ",$k+1,"=================\n";

    $cmd = "./mywget ".$url;

    echo $cmd."\n=================测试结果=================\n";

    $fp = popen($cmd, "r");

    while (!feof($fp)) {
        echo fgets($fp,4096);
    }
}
